<template>
<h1>杨硕EL_单选组件</h1>
  <el-radio-group v-model="edu">
    <el-radio label="学历：高中" value="高中"></el-radio>
    <el-radio label="学历：专科" value="专科"></el-radio>
    <el-radio label="学历：本科" value="本科"></el-radio>
    <el-radio label="学历：硕士" value="硕士"></el-radio>
  </el-radio-group>
  <h4>您为杨硕选择的学历是：{{edu}}</h4>
  <el-radio-group v-model="res">
    <el-radio v-for="item in arr" :label="item.title" :value="item.price"></el-radio>
  </el-radio-group>
  <h4>您为杨硕选择的酒价是：{{res}}</h4>
</template>
<script setup>
//定义变量用来保存选择的学历选项值
import {ref} from "vue";

const  edu=ref('硕士')
//定义数组用来模拟从后端数据库中查出来的商品数据

const arr=ref([
    {title:'杨硕',price:10000},
    {title:'杨硕爱吃糖',price:2000},
    {title:'杨硕爱睡觉',price:3000},
    {title:'杨硕爱听歌',price:4000},
    {title:'杨硕爱看小说',price:5000}
]);
//定义变量用来保存杨硕商品单选组提交的值
const  res=ref(6000);
</script>


<style scoped>

</style>